<template>
	<view class="video-box m-b-25" v-for="item,index in props.data.list" :key="index">
		<video class="video" :src="item.url" :autoplay="autoplay" :poster="item.image"></video>
	</view>
</template>
<script setup lang="ts">
	import { ref, onMounted } from 'vue';

	const props = withDefaults(defineProps<{
		data : any,
	}>(), {
		data: {},
	});

	let autoplay = ref(false);

	onMounted(() => {
		if (props.data.autoplay == true || props.data.autoplay == 'true') {
			autoplay.value = true;
		}
	})
</script>
<style lang="scss" scoped>
	.video-box {
		border-radius: 15rpx;
		overflow: hidden;

		.video {
			width: 100%;
			height: 400rpx;
			border-radius: 15rpx;
		}
	}
</style>